import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [

    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/home',
      name: 'userHome',
      component: () => import('../views/UserHome.vue'),
    },
    {
      path: '/search',
      name: 'userSearch',
      component: () => import('../views/SearchPage.vue'),
    },
    {
      path: '/product/detail',
      name: 'productDetail',
      component: () => import('../views/ProductDetail.vue'),
    },
    {
      path: '/cart',
      name: 'shoppingCart',
      component: () => import('../views/ShoppingCart.vue'),
    },
    {
      path: '/order/submit',
      name: 'orderSubmit',
      component: () => import('../views/OrderSubmit.vue'),
    },
    {
      path: '/payment/:orderNo',
      name: 'paymentPage',
      component: () => import('../views/PaymentPage.vue'),
    },
    {
      path: '/personal',
      name: 'personalCenter',
      component: () => import('../views/PersonalCenter.vue'),
    },
    {
      path: '/address',
      name: 'addressManagement',
      component: () => import('../views/AddressManagement.vue'),
    },
    {
      path: '/address',
      name: 'addressManagement',
      component: () => import('../views/AddressManagement.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/LoginView.vue'),
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/RegisterView.vue'),
    },
    {
      path: '/orderManagement',
      name: 'orderManagement',
      component: () => import('../views/OrderManagement.vue'),
    },
    {
      path: '/orderDetails',
      name: 'orderDetails',
      component: () => import('../views/OrderDetails.vue'),
    },
    {
      path: '/test-ai',
      name: 'testAI',
      component: () => import('../views/TestAI.vue'),
    },
    
  ],
})

export default router